<%inherit file="/base_tpapp.html"/>

<%block name="right_content">
    <link rel="stylesheet" type="text/css" href="${STATIC_URL}css/paas_app.${CSS_SUFFIX}?v=${STATIC_VERSION}">
        <div class="ml50 app-info">
            <div class="t_b mb10">${_(u'注册信息')}
            </div>
            <div class="row">
                <div class="col-sm-4 col-xs-4">
                    <font class="t_grey">${_(u'应用ID')}：</font>${app_info.get('code', '--')}
                </div>
                <div class="col-sm-8 col-xs-8">
                    <font class="t_grey"> ${_(u'应用 TOKEN')}：</font>${app_info.get('auth_token', '--')}
                </div>

            </div>
        </div>
        <hr/>
        <div class="ml50 app-info">
            <div class="t_b mb10">${_(u'应用简介')}
                <div class="f_r mr30">
                    <a href="###" style="margin-left:10px;font-weight: 400;display:none;" class="can_a" id="introduction_cancle">${_(u'取消')}</a>
                    <a href="###" style="margin-left:10px;font-weight: 400;" id="intro_operate" data="0" class="operate" edit-class="introduction">${_(u'编辑')}</a>
                </div>
                <span id="tip_introduction" style="color: #f00;" class="f_r app-info-tips"></span>
            </div>
            <div class="row">
                <div class="col-sm-10 col-xs-10">
                    <input type="text" class="form-control app-edit app-value" id="introduction" name="introduction"  value="${app_info.get('introduction', '')}" style="display:none;width:908px;">
                    <div id="intro_value" value="${app_info.get('introduction', '')}" class="introduction">${app_info.get('introduction', '--') | h}</div>
                </div>
            </div>
        </div>
        <hr/>
        <div class="ml50 app-info">
            <div class="t_b mb10">${_(u'基本信息')}
                <div class="f_r mr30">
                    <a href="###" style="margin-left:10px;font-weight: 400;display:none;" class="can_a" id="base_cancle">${_(u'取消')}</a>
                    <a href="###" style="margin-left:10px;font-weight: 400;" id="base_operate" data="0" class="operate" edit-class="base">${_(u'编辑')}</a>
                </div>
                <span id="tip_name" style="color: #f00;" class="f_r app-info-tips"></span>
            </div>
            <div class="row">
                <div class="col-sm-4 col-xs-4">
                    <input type="hidden" id="app_code_id" value="${app_info.get('code', '--')}"></input>
                    <font class="t_grey">${_(u'应用 ID')}：</font>${app_info.get('code', '--')}
                </div>
                <div class="col-sm-4 col-xs-4">
                    <font class="t_grey f_l">${_(u'应用名称')}：</font>
                    <input type="text" class="form-control app-edit app-value" id="name" name="name" value="${app_info.get('name', '--')}" operation="modify" style="width:200px;margin-top:-6px;display:none;">
                    <div id="app_name" class="base">${app_info.get('name', '--') | h}</div>
                </div>
            </div>
            <div class="row mt5 chmt">
                <div class="col-sm-4 col-xs-4">
                    <font class="t_grey">${_(u'状态')}：</font>${app_info.get('state_display', '--') or '--'}
                </div>
                <div class="col-sm-4 col-xs-4">
                    <font class="t_grey">${_(u'首次上线')}：</font>${app_info.get('first_online_time',  '--') or '--'}
                </div>
            </div>
            <div class="row mt5 chmt">
                <div class="col-sm-4 col-xs-4">
                    <div class=""><font class="t_grey">${_(u'创建者')}：</font>${app_info.get('creater', '--')}</div>
                </div>
                <div class="col-sm-4 col-xs-4">
                    <div class=""><font class="t_grey">${_(u'创建时间')}：</font>${app_info.get('create_time', '--')}</div>
                </div>
            </div>
            <div class="row mt5 chmt">
                <div class="col-sm-4 col-xs-4">
                    <font class="t_grey f_l">${_(u'系统链接')}：</font>
                    <input type="text" class="form-control app-edit app-value" id="external_url" name="external_url"  value="${app_info.get('external_url', '')}" style="width:200px;margin-top:-6px;display:none;">
                    <div class="base">${app_info.get('external_url', '--') or '--'}</div>
                </div>
            </div>
            <div class="row mt5 chmt">
                <div class="col-sm-10 col-xs-10" style="width:100%">
                    <div class="row" >
                        <div class="col-sm-2 col-xs-2">
                            <div><font class="t_grey">${_(u'应用分类')}：</font></div>
                        </div>
                        <div class="col-sm-8 col-xs-8" style="margin-left: -93px;">
                            <div id="app_tags_div" class="app-edit" style="display:none;">
                                <select class="form-control" id="app_tags" style="width: 200px;">
                                    % for tag in tags:
                                        % if tag[0] == app_info.get('tags_code', ''):
                                            <option value="${tag[0]}" selected>${tag[1]}</option>
                                        % else:
                                            <option value="${tag[0]}">${tag[1]}</option>
                                        % endif
                                    % endfor
                                </select>
                            </div>
                            <div id="app_tags_dis" class="base" >${app_info.get('tags', '--') or '--'}</div>
                        </div>
                    </div>
                </div>
            </div>

        </div>
        <hr/>
        <div class="ml50 app-info">
            <div class="t_b mb10">${_(u'桌面信息')}
                <div class="f_r mr30">
                    <a href="###" style="margin-left:10px;font-weight: 400;display:none;" class="can_a" id="desktop_cancle">${_(u'取消')}</a>
                    <a href="###" style="margin-left:10px;font-weight: 400;" id="desktop_operate" data="0" class="operate" edit-class="desktop">${_(u'编辑')}</a>
                </div>
                <span id="tip_desktop" style="color: #f00;" class="f_r app-info-tips"></span>
            </div>
            <div class="row mt5 chmt">
                <div class="col-sm-4 col-xs-4">
                    <font class="t_grey f_l">${_(u'窗口宽度')}：</font>
                    <input type="number" class="form-control app-edit app-value" id="width" name="width" value="${app_info.get('width')}" min="1" operation="modify" style="width: 90px; margin-top: -1px; display: none;">
                    <div id="width_value" class="desktop f_l">${app_info.get('width')}</div><span class="desktop_wh_px">px</span>
                </div>
                <div class="col-sm-4 col-xs-4">
                    <font class="t_grey f_l">${_(u'窗口高度')}：</font>
                    <input type="number" class="form-control app-edit app-value" id="height" name="height"  value="${app_info.get('height')}" min="1" operation="modify" style="width: 90px; margin-top: -1px; display: none;">
                    <div id="height_value" class="desktop f_l">${app_info.get('height')}</div><span class="desktop_wh_px">px</span>
                </div>
            </div>
            <div class="row mt5 chmt">
                <div class="col-sm-10 col-xs-10" style="width:100%">
                    <div class="row" >
                        <div class="col-sm-2 col-xs-2">
                            <div><font class="t_grey"> ${_(u'打开方式')}：</font></div>
                        </div>
                        <div class="col-sm-8 col-xs-8" style="margin-left: -92px;">
                            <div id="open_mode_div" class="app-edit" style="display:none;">
                                <select class="form-control" id="open_mode_choices" style="width: 200px;">
                                    % for mode in open_mode_choices:
                                        % if mode[0] == app_info.get('open_mode'):
                                            <option value="${mode[0]}" selected>${mode[1]}</option>
                                        % else:
                                            <option value="${mode[0]}">${mode[1]}</option>
                                        % endif
                                    % endfor
                                </select>
                            </div>
                            <div id="open_mode_dis" class="desktop" >${app_info.get('open_mode_name', '--') or '--'}</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <hr/>
        <div class="ml50 app-info">
            <div class="t_b mb10">${_(u'访问地址')}
            </div>
            <div class="row">
                <div class="col-sm-10 col-xs-10">
                    <font class="t_grey">${_(u'访问入口')}：</font> <span id="prod_access_span"></span>
                </div>
            </div>
        </div>
        <hr/>
        <div class="ml50">
            <div class="t_b mb10">${_(u'删除应用')}</div>
            <div class="row">
                <div class="col-sm-10 col-xs-10">
                    % if app_info.get('state', '') == 1:
                        <div class="mb5">${_(u'应用开发者能删除该应用，请在删除前与其他同事提前沟通，确定')}<a href="###" onclick="REL_MANAGER.tpapp_del(this, '${app_info.get('code', '')}');" app_code="${app_info.get('code', '')}" class="hit app_del"><strong>${_(u'删除')}</strong></a>!</div>
                    % else:
                        <div class="mb5">${_(u'只有开发中的应用才能删除，提测和上线过的应用不能删除！')}</div>
                    % endif
                </div>
            </div>
        </div><hr/>
</%block>

<script src="${STATIC_URL}js/paas_release.${JS_SUFFIX}"></script>
<script src="${STATIC_URL}js/paas_app.${JS_SUFFIX}"></script>
<script type="text/javascript">
    $(function(){
        APP_INFO.get_tpapp_access_info('${app_code}');
    })
</script>
